<?php
/**
 * Created by PhpStorm.
 * User: ZNZG
 * Date: 2022/3/16
 * Time: 16:37
 */

namespace app\api\validate;


class User extends BaseValidate
{
    protected $rule = [
        'id' => 'require',
        'name' => 'require|unique:user',
        'phone' => 'require|mobile|unique:user'
    ];

    protected $message = [
        'id.require' => 'ID必须',
        'phone.require' => '手机号必须',
        'phone.mobile' => '手机号格式有误',
        'phone.unique' => '手机号已被占用',
        'name.require' => '名称必须',
        'name.unique' => '名称已被占用'
    ];

    protected $scene = [
        'save' => ['name','phone'],
        'update' => ['name','phone','id'],
        'delete' => ['id'],
    ];
}